import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import MainBox from '../views/MainBox'
import LoginAndReContainer from '../views/LoginAndReContainer.vue'
import AddFriend from '../components/add/AddFriend.vue'
import AddGroup from '../components/add/AddGroup.vue'
// import TRTCCalling from '../test/TRTCCalling.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  // {
  //   path: '/test',
  //   component: TRTCTest
  // },
  {
    // 主界面
    path: '/mainbox',
    component: MainBox,
    children: [
      {
        path: '/addfriend',
        component: AddFriend
      },
      {
        path: '/addgroup',
        component: AddGroup
      }
    ]
  },
  {
    // 登录和注册界面的容器
    path: '/lrcontainer',
    component: LoginAndReContainer,
    children: [
      {
        path: '/login',
        component: Login
      },
      {
        path: '/register',
        component: Register
      }
    ]
  }
  // 设置部分
  // {
  //   path: '/setting',
  //   component: Setting,
  //   children: [
  //     {
  //       path: '/updateSelf',
  //       component: UpdateSelf
  //     }
  //   ]
  // }
]

const router = new VueRouter({
  routes
})

export default router
